package com.panda.config;/**
 * @author 乐于吕
 * * @date 2024/10/15
 */

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 *@Author: 乐于吕
 *@CreateTime: 2024-10-15
 *@Description: `使用Ribbon注解实现负载均衡前需要使用配置类配置RestTemplate`
 */

@Configuration
public class BeansConfig {
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}